module.exports = {
  'GET /api/school': {
    data: [
      {
        id: '12345678901234567890',
        name: '翰锦中学1',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567891',
        name: '翰锦中学2',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567892',
        name: '翰锦中学3',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567893',
        name: '翰锦中学4',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567894',
        name: '翰锦中学5',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567895',
        name: '翰锦中学6',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567896',
        name: '翰锦中学7',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567897',
        name: '翰锦中学8',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567898',
        name: '翰锦中学9',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567899',
        name: '翰锦中学10',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567881',
        name: '翰锦中学11',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567882',
        name: '翰锦中学12',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567883',
        name: '翰锦中学13',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567884',
        name: '翰锦中学14',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 0,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567885',
        name: '莲塘中学1',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 1,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567886',
        name: '莲塘中学1',
        groupId: '98765432109876543210',
        groupName: '翰锦集团',
        status: 1,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567887',
        name: '莲塘中学1',
        groupId: '98765432109876543210',
        groupName: 'BBBBB集团',
        status: 1,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
      {
        id: '12345678901234567888',
        name: '莲塘中学1',
        groupId: '98765432109876543210',
        groupName: 'AAAAA集团',
        status: 1,
        provinceId: 123,
        provinceName: '广东省',
        cityId: 123,
        cityName: '深圳市',
        regionId: 123,
        regionName: '罗湖区',
        address: '莲塘街道国威大厦2005',
        longitude: 123.123,
        latitude: 123.123,
        website: 'http://www.hanjin.com.cn/',
        createTime: '2022-12-06T05:00:57.040Z',
        creator: '阿财',
        updateTime: '2022-12-06T05:00:57.040Z',
        updater: '阿财',
      },
    ],
    total: 18,
    success: true,
    pageSize: 10,
    current: 1,
  },

  'GET /api/school/:id': (req, res) => {
    const { id } = req.params;
    const schools = module.exports['GET /api/school'].data;
    const school = schools.find(item => item.id === id);

    if (school) {
      res.status(200).send({
        data: school,
        success: true,
      });
    } else {
      res.status(404).send({
        success: false,
        message: '找不到该学校',
      });
    }
  },

  'POST /api/school': (req, res) => {
    const { name, groupName, address, regionName } = req.body;

    if (!name || !groupName || !address || !regionName) {
      res.status(400).send({
        success: false,
        message: '请填写所有必填字段',
      });
      return;
    }

    res.status(200).send({
      success: true,
      message: '添加学校成功',
      data: {
        id: `${Date.now()}`,
        name,
        groupName,
        address,
        regionName,
        createTime: new Date().toISOString(),
        updateTime: new Date().toISOString(),
      },
    });
  },

  'PUT /api/school/:id': (req, res) => {
    const { name, groupName, address, website } = req.body;
    const { id } = req.params;

    if (!id || !name || !groupName || !address) {
      res.status(400).send({
        success: false,
        message: '请填写所有必填字段',
      });
      return;
    }

    res.status(200).send({
      success: true,
      message: '更新学校成功',
      data: {
        id,
        name,
        groupName,
        address,
        website,
        updateTime: new Date().toISOString(),
      },
    });
  },

  'DELETE /api/school/:id': (req, res) => {
    const { id } = req.params;

    if (!id) {
      res.status(400).send({
        success: false,
        message: '请提供学校ID',
      });
      return;
    }

    res.status(200).send({
      success: true,
      message: '删除学校成功',
    });
  },
};
